// run: $exec < input
#include <iostream>
#include <cstdio>
#include <algorithm>

int const maxn = 101000;
int a[maxn], left[maxn], right[maxn];
int q[4 * maxn];
int min_last[maxn];
int n;

int main()
{
	std::scanf("%d", &n);
	for (int i = 0; i < n; i++) std::scanf("%d", &a[i]);

	left[0] = 1;
	for (int i = 1; i < n; i++)
		if (a[i] > a[i - 1]) left[i] = left[i - 1] + 1;
		else left[i] = 1;

	right[n - 1] = 1;
	for (int i = n - 2; i >= 0; i--)
		if (a[i] < a[i + 1]) right[i] = right[i + 1] + 1;
		else right[i] = 1;

	int ans = std::max(left[n - 2] + 1, right[1] + 1);
	for (int i = 1; i < n; i++)
		ans = std::max(ans, left[i - 1] + 1);
	for (int i = 0; i < n - 1; i++)
		ans = std::max(ans, right[i + 1] + 1);
	for (int i = 1; i < n - 1; i++)
		if (a[i - 1] + 1 < a[i + 1]) ans = std::max(ans, left[i - 1] + right[i + 1] + 1);
	std::printf("%d\n", ans);
}

